#include "DistributedClient.h"
#include "../DistributedPackets.h"

DistributedClient::DistributedClient(string serverAddress, unsigned short serverPort, unsigned short incomingPort) {
    this->serverAddress = serverAddress;
    this->serverPort = serverPort;
    this->incomingPort = incomingPort;
    this->state = AWAITING_JOB;
    
    socket(incomingPort);
    packet.signal = REQUEST_JOB;
    bufferLength = DistributedPackets::packetToBytes(buffer, BUFFER_SIZE, packet);
}

void DistributedClient::go() {
    switch(state) {
        case AWAITING_JOB:
            socket.sendTo(buffer, bufferLenth, serverAddress, serverPort);
            
            socket.
            
            break;
        case AWAITING_START_CONFIRMATION:
            break;    
        case AWAITING_RECIEPT_CONFIRMATION:
            break;
    }
}


